//
//  MainTableViewCell.m
//  GiftItems
//
//  Created by lanou3g on 15/9/18.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MainTableViewCell.h"

@implementation MainTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(10,10, kWidth - 20, 150)];
        self.imageV.backgroundColor = [UIColor orangeColor];
        self.imageV.layer.masksToBounds = YES;
        self.imageV.layer.cornerRadius = 5;
        
        [self.contentView addSubview:self.imageV];
        
        //设置模糊视图
        UIVisualEffectView *backImage = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:(UIBlurEffectStyleDark)]];
        backImage.frame = CGRectMake(kWidth - 90, 20, 60, 24);
        backImage.alpha = 0.4;
        backImage.layer.masksToBounds = YES;
        backImage.layer.cornerRadius = 12;
        
        [self.imageV addSubview:backImage];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 140, kWidth - 40, 16)];
        self.titleLabel.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
        [self.contentView addSubview:self.titleLabel];
        
        self.selectionStyle = NO;
        
        
        self.LickCountButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.LickCountButton.frame = CGRectMake(kWidth - 80, 30, 60, 24);
        self.LickCountButton.tintColor = [UIColor whiteColor];
        [self.LickCountButton setImage:[UIImage imageNamed:@"profile_btn_unlike"] forState:(UIControlStateNormal)];
        self.LickCountButton.titleLabel.font = [UIFont systemFontOfSize:12];
        
        [self.contentView addSubview:self.LickCountButton];
        
        
        
        
    }
    
    return self;
}

- (void)shareMainImageModel:(MainBoutiqueModel *)model {
    
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:model.cover_image_url] placeholderImage:[UIImage imageNamed:@"300 * 147"]];
    
    self.titleLabel.text = model.title;
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    
    
    [self.LickCountButton setTitle:[NSString stringWithFormat:@"  %@",model.likes_count] forState:(UIControlStateNormal)];
    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
